package utilities;

import com.googlecode.javacv.cpp.opencv_calib3d.*;
import static com.googlecode.javacv.cpp.opencv_core.*;
import com.googlecode.javacv.cpp.opencv_calib3d.*;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;

/**
 *
 * @author Ashen
 */
public class FindEdges {

    //Pass 8,1 image
    private IplImage edgedetection(IplImage img) {
        IplImage edges = cvCreateImage(cvGetSize(img), 8, 1);
        cvCanny(img, edges, 150, 255, 3);
        return edges;
    }

    //still not working properly
    private IplImage cornerDetector(IplImage img) {
        IplImage corners = cvCreateImage(cvGetSize(img), IPL_DEPTH_32F, 1);
        cvCornerHarris(img, corners, 3, 11, 0.07);
        int r = corners.asCvMat().rows();
        int c = corners.asCvMat().cols();
        for (int i = 0; i < r; i++) {
            for (int j = 0; j < c; j++) {
                System.out.println("i,j=" + corners.asCvMat().get(i, j));
            }

        }
        return corners;
    }
}
